<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>节目详情</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="resources/jquery-easyui-1.5.3/themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="resources/jquery-easyui-1.5.3/themes/icon.css">
		<script type="text/javascript" src="resources/jquery-easyui-1.5.3/jquery.min.js"></script>
		<script type="text/javascript" src="resources/jquery-easyui-1.5.3/jquery.easyui.min.js"></script>

	</head>
	<body onload="init()">
		<div>
		<button onclick="showS()" style="width:120px;height:40px;position: absolute;top:300px;left:75px;border-radius: 5px;font-family: '幼圆';">显示全部剧集</button>
			<form action="">
				<div style="position: absolute;top:20px;left:60px;border:1px #95B8E7 solid;width:160px;height:241px;"><img width="160px" height="241px" id="img" src="" alt=""></div>
				<div style="position: absolute;top:20px;left:316px;font-family: '幼圆';">节目id : <input type="text" readOnly="true" name="id" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:60px;left:300px;font-family: '幼圆';">节目code : <input type="text" readOnly="true" name="code" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:100px;left:300px;font-family: '幼圆';">节目名称 : <input type="text" readOnly="true" name="program_name" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:140px;left:332px;font-family: '幼圆';">类型 : <input type="text" readOnly="true" name="type" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:180px;left:332px;font-family: '幼圆';">状态 : <input type="text" readOnly="true" name="status" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:220px;left:332px;font-family: '幼圆';">集数 : <input type="text" readOnly="true" name="episode" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:260px;left:316px;font-family: '幼圆';">总集数 : <input type="text" readOnly="true" name="series" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:300px;left:332px;font-family: '幼圆';">期数 : <input type="text" readOnly="true" name="periods" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:20px;left:690px;font-family: '幼圆';">导演 : <input type="text" readOnly="true" name="director" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:60px;left:690px;font-family: '幼圆';">演员 : <input type="text" readOnly="true" name="actors" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:100px;left:658px;font-family: '幼圆';">上映时间 : <input type="text" readOnly="true" name="release_time" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:140px;left:690px;font-family: '幼圆';">语言 : <input type="text" readOnly="true" name="language" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:180px;left:690px;font-family: '幼圆';">地区 : <input type="text" readOnly="true" name="area" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:220px;left:690px;font-family: '幼圆';">拼音 : <input type="text" readOnly="true" name="search_pinyin" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:260px;left:674px;font-family: '幼圆';">关键字 : <input type="text" readOnly="true" name="key_words" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>	
				<div style="position: absolute;top:300px;left:658px;font-family: '幼圆';">精彩看点 : <input type="text" readOnly="true" name="wonderful_view" style="border:1px #95B8E7 solid;width:230px;height:25px;border-radius: 4px;"></div>
				<div style="position: absolute;top:340px;left:658px;font-family: '幼圆';">节目描述 : <div style="position: absolute;top:0px;left:88px;"><textarea id="description" readOnly="true" name="description" style="border:1px #95B8E7 solid;width:230px;height:100px;resize: none;text-overflow: ellipsis;border-radius: 4px;font-family: '幼圆';"></textarea></div></div>
				<fieldset style="position: absolute;top:450px;left:60px;width:900px;font-family: '幼圆';">
					<legend>全部图片预览</legend>
					<div id='allpic'></div>
				</fieldset>		

			</form>
		</div>
		


		<script>
			function showS(){
				title = jutou+'_剧集列表';
	            var jq=top.jQuery;
	            //console.log(row); 
				if(!jq('#tt').tabs('exists',title)){
					jq('#tt').tabs('add',{
						id:id,
					    title:title,
					    border: false,
					    content:'<iframe scrolling="all" frameborder="0"  src="juji.php?program_id='+id+'" style="width:100%;height:100%;"></iframe>',
					    closable:true
					});
				}else{
					jq('#tt').tabs('select',title);
				}
			}

			function GetQueryString(name) {
			     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
			     var r = window.location.search.substr(1).match(reg);
			     if(r!=null)return  unescape(r[2]); return null;
			}

			var id = GetQueryString('id');
			console.log(id);

			var jutou;
			function init(){
				$.ajax({
						url : 'http://gyp.meidongya.cn/program/detail',
						type : 'post',
						data : {
							id : id,
						},
						success : function (data, response, status) {
							data = eval('(' +data+ ')');
							console.log(data);
							var pic_url = data.address[4]['file_url'];
							pic_url = pic_url.replace("/home","");
							for(var i in data) {
							     //console.log(i,":",data[i]);
							     $("input[name='"+i+"']").val(data[i]);
							}
							jutou = data['program_name']; 
							$('#description').val(data.description);
							$('#img').attr('src','http://121.196.216.15'+pic_url);

							var pic_list = data.address;
							var html = '';
							for (var i = 0, length = pic_list.length; i < length; i++) {
								var picurl = pic_list[i]['file_url'].replace("/home","");
								if(pic_list[i]['cp_type']==1){
									var picinfo = "图片类型为1,横图";
								}else if(pic_list[i]['cp_type']==2){
									var picinfo = "图片类型为2,竖图";
								}else if(pic_list[i]['cp_type']==3){
									var picinfo = "图片类型为3,小图";
								}else if(pic_list[i]['cp_type']==4){
									var picinfo = "图片类型为4,IPTV 高清图";
								}else if(pic_list[i]['cp_type']==5){
									var picinfo = "图片类型为5,IPTV 标清图";
								}else if(pic_list[i]['cp_type']==6){
									var picinfo = "图片类型为6,IPTV 高清缩略图";
								}else if(pic_list[i]['cp_type']==7){
									var picinfo = "图片类型为7,IPTV 标清缩略图";
								}else if(pic_list[i]['cp_type']==17){
									var picinfo = "图片类型为17,海报图";
								}else{
									var picinfo = "图片类型为其他,其他图类型";
								}
								//console.log("http://121.196.216.15"+picurl);
								var purl = "http://121.196.216.15"+picurl;
								html += '<div><img src='+ purl+'>'+picinfo+'</div>';
							}
							$('#allpic').html(html);
							if($("input[name='type']").val()!=3){
								$("input[name='type']").val('剧集');
							}else{
								$("input[name='type']").val('剧头');
							};
							if($("input[name='status']").val()==0){
								$("input[name='status']").val('上线');
							}else{
								$("input[name='status']").val('下线');
							};
						}
					});
			}
		</script>
	</body>
</html>
